home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-15 | 2.1 KB | 77 lines | [TEXT/MPS ] |
- #
- # File: LinkSharedLibrary
- #
- # Contains: Script to link a shared library
- #
- # Copyright: © 1992 by Apple Computer, Inc., all rights reserved.
- #
- #
-
- Set Init ""
- Set OutFile ""
- Set Far ""
- Set RezIn ""
- Set InObj ""
- Set Error 0
- If "{TempFolder}" != ""
- Set Scratch "{TempFolder}"
- Else
- Set Scratch "{CPlusScratch}"
- End
- LOOP
- If "{1}" == "" || "{1}" !~ /-≈/
- Break;
- Else If "{1}" =~ /-link/
- Shift; Break;
- Else If "{1}" =~ /-far/
- Set Far "{2}"; Shift 2; Continue
- Else If "{1}" =~ /-init/
- Set Init "{2}"; Shift 2; Continue
- Else If "{1}" =~ /-obj/
- Set InObj "{2}"; Shift 2; Continue
- Else If "{1}" =~ /-rez/
- Set RezIn "{2}"; Shift 2; Continue
- Else If "{1}" =~ /-o/
- Set OutFile "{2}"; Shift 2; Continue
- Else
- Set Error 1
- Break;
- End
- Shift
- End
- If "{Init}" == "" || "{RezIn}" == "" || "{InObj}" == "" || "{OutFile}" == ""
- Set Error 1
- End
- If {Error}
- Echo "Usage: LinkSharedLibrary -o <OutFile>"
- Echo " -obj <OutputObjectFile> -init <LibraryInitObjectFile>"
- Echo " -rez <.libr Src Rez File> -far <FarClientFile>"
- Echo " -link"
- Echo " <LibsToLinkWith>"
- Echo ""
- Echo "Must be used after using MakeSharedClientFiles"
- Echo ""
- Echo " Everything after -link will be passed to the linker directly."
- Echo " The list of libraries to link with must be last"
- Echo " or after the -link switch."
- Echo " The link automatically merges segments Main, STDCLIB, and SANELIB."
- Exit 10
- End
- If {Progress}
- Echo "∂t∂tCreating shared Library file ∂"{OutFile}∂""
- End
- Link -model far -srtsg all -d -t rsrc -c RSED -sn STDCLIB=Main -sn SANELIB=Main ∂
- -sg %A5Init=A5Init -m DynamicCodeEntry -o "{Scratch}SLMTemp.RSRC" ∂
- "{Init}" "{InObj}" "{Far}" ∂
- {"Parameters"}
-
- Duplicate -y "{RezIn}" "{Scratch}SLMTemp.temp.r"
- Echo "Include ∂"{Scratch}SLMTemp.RSRC∂" 'CODE' as SLMType;" >> "{Scratch}SLMTemp.temp.r"
- Echo "Delete SLMType (∂"32-bit bootstrap∂");" >> "{Scratch}SLMTemp.temp.r"
-
- Delete -i "{OutFile}" ∑∑ Dev:Null
- Rez -a -t libr -c OMGR ∂
- -o "{OutFile}" "{Scratch}SLMTemp.temp.r"
- SetFile -a ib "{OutFile}"
- delete -i "{Scratch}SLMTemp.temp.r" "{Scratch}SLMTemp.RSRC"
-